﻿<UserControl x:Class="Shweet.Silverlight.Views.ShweetMain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="289" d:DesignWidth="564" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:converter="clr-namespace:Shweet.Silverlight">
    
    <UserControl.Resources>
        <converter:BindingDebugging x:Key="FormatConverter" /> 
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="46*" />
            <RowDefinition Height="243*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="123*" />
            <ColumnDefinition Width="394*" />
            <ColumnDefinition Width="47*" />
        </Grid.ColumnDefinitions>
        <TextBlock Text="What's happening : "  FontSize="12"  Grid.Row="0" Grid.Column="0"/>
        <TextBox Name="shweetText"  Grid.Column="1" />
        <TextBox Name="charsToGo" Text="140"  Grid.Column="2"  />
        <ListBox Name="shweetMessages" Grid.ColumnSpan="3" Grid.Row="1" ItemsSource="{Binding CurrentShweets}" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" >
                        <TextBlock Text="{Binding Path=Text}" Margin="5"/>
                        <TextBlock Foreground="Black" Text="{Binding Path=User, Converter={StaticResource FormatConverter}}" Margin="5"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
